<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>表单输入绑定</title>
</head>

<body>
    <div id="app">
        <input type="checkbox" v-model="checked" />
        <label for="checkbox">{{ checked }}</label>

        <hr>

        <input type="checkbox" id="jack" value="Jack" v-model="checkedNames">
        <label for="jack">Jack</label>
        <input type="checkbox" id="john" value="John" v-model="checkedNames">
        <label for="john">John</label>
        <input type="checkbox" id="mike" value="Mike" v-model="checkedNames">
        <label for="mike">Mike</label>
        <br>
        <span>Checked names: {{ checkedNames }}</span>
    </div>

    <script type="module">
        import Vue from '../vue.esm.browser.js'

        const app = new Vue({
            el: '#app',
            data: {
                checked: false,
                checkedNames: []
            }
        })
    </script>
</body>

</html>